package com.massfords.jaxb;

import java.util.Set;

import com.sun.codemodel.JDefinedClass;
import com.sun.codemodel.JPackage;
import com.sun.tools.xjc.outline.ClassOutline;
import com.sun.tools.xjc.outline.Outline;

/**
 * Base class for creating code. Pattern here is to run through the set of generated beans
 * and produce some new interface or class in the form of a JDefinedClass.
 * 
 * @author markford
 */
public abstract class CodeCreator {

    protected JPackage mPackage;
    protected Outline mOutline;
    private JDefinedClass mOutput;

    public CodeCreator(Outline aOutline, JPackage aPackage) {
        setOutline(aOutline);
        setPackage(aPackage);
    }

    protected abstract void run(Set<ClassOutline> aClasses);

    protected JDefinedClass getOutput() {
        return mOutput;
    }
    
    protected void setOutput(JDefinedClass aOutput) {
        mOutput = aOutput;
    }

    protected JPackage getPackage() {
        return mPackage;
    }

    protected void setPackage(JPackage aPackage) {
        mPackage = aPackage;
    }


    protected Outline getOutline() {
        return mOutline;
    }

    protected void setOutline(Outline aOutline) {
        mOutline = aOutline;
    }

}
